package net.minecraft.src;

public class ModelTrilobite extends ModelBase
{
	public ModelTrilobite()
	{
		body = new ModelRenderer(this, 0, 0);
		body.addBox(0F, 0F, 0F, 7, 1, 5);
		body.setRotationPoint(-6F, 23F, -3F);
		body.rotateAngleX = 0F;
		body.rotateAngleY = 0F;
		body.rotateAngleZ = 0F;
		body.mirror = false;
		ridge = new ModelRenderer(this, 0, 6);
		ridge.addBox(0F, 0F, 0F, 7, 1, 1);
		ridge.setRotationPoint(-6F, 22F, -1F);
		ridge.rotateAngleX = 0F;
		ridge.rotateAngleY = 0F;
		ridge.rotateAngleZ = 0F;
		ridge.mirror = false;
		tail = new ModelRenderer(this, 0, 8);
		tail.addBox(0F, 0F, 0F, 6, 1, 1);
		tail.setRotationPoint(1F, 23F, -1F);
		tail.rotateAngleX = 0F;
		tail.rotateAngleY = 0F;
		tail.rotateAngleZ = 0.11154F;
		tail.mirror = false;
		head = new ModelRenderer(this, 24, 0);
		head.addBox(0F, 0F, 0F, 1, 1, 3);
		head.setRotationPoint(-7F, 23F, -2F);
		head.rotateAngleX = 0F;
		head.rotateAngleY = 0F;
		head.rotateAngleZ = 0F;
		head.mirror = false;
	}

	public void setLivingAnimations(EntityLiving entityliving, float f, float f1, float f2)
	{
		EntityTrilobite tr = (EntityTrilobite)entityliving;
		if(tr.tailMovement == 0)
		{
			if(tr.rand.nextInt(100) < 3)
				tr.tailMovement = 1;
			tail.rotateAngleZ = 0.11154F;
		}
		else
		{
			tail.rotateAngleZ = 0.11154F - (tr.tailMovement * 0.05F);
			if(++tr.tailMovement > 10)
				tr.tailMovement = 0;
		}
	}

	public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
	{
		super.render(entity, f, f1, f2, f3, f4, f5);
		setRotationAngles(f, f1, f2, f3, f4, f5);
		body.render(f5);
		ridge.render(f5);
		tail.render(f5);
		head.render(f5);
	}

	public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
	{
		super.setRotationAngles(f, f1, f2, f3, f4, f5);
	}

	ModelRenderer body;
	ModelRenderer ridge;
	ModelRenderer tail;
	ModelRenderer head;
}
